import { runCommand } from ".";

export default {
    canUndo: true,
    execute: (context, options, isUndo) => {
        runCommand(context, options, isUndo, (sheet, options) => {
            const { selections, backColor } = options;
            selections.forEach(range => {
                sheet.getRange(range.row == -1 ? 0 : range.row, range.col == -1 ? 0 : range.col , range.rowCount, range.colCount).backColor(backColor);
            })
        })
    }
};
